﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Reflection;

namespace HML.Design
{
    /// <summary>
    /// 集合属性编辑窗口扩展(显示属性详细描述信息)
    /// </summary>
    public class CollectionHelpEditor : CollectionEditor
    {
        public CollectionHelpEditor(Type type) : base(type)
        {

        }

        protected override CollectionForm CreateCollectionForm()
        {
            CollectionForm frm = base.CreateCollectionForm();
            FieldInfo fileinfo = frm.GetType().GetField("propertyBrowser", BindingFlags.NonPublic | BindingFlags.Instance);
            if (fileinfo != null)
            {
                (fileinfo.GetValue(frm) as System.Windows.Forms.PropertyGrid).HelpVisible = true;
            }
            frm.Width = 800;
            frm.Height = 600;
            return frm;
        }
    }
}
